package main

import "fmt"

// 定义结构体
type Student4 struct {
	id      int
	name    string
	age     int
	gender  string //字符类型
	address string
}

func main() {
	// 声明结构体数组
	var arr [3]Student4
	arr[0] = Student4{1, "zhangsan", 22, "male", "beijing"}
	arr[1] = Student4{2, "lisi", 22, "male", "beijing"}
	arr[2] = Student4{3, "wangwu", 22, "male", "beijing"}

	// 打印
	fmt.Println(arr)

	// 遍历
	fmt.Println("-----------------------")
	for _, student := range arr {
		fmt.Println(student)
	}
}
